#!/bin/bash

gcc -o lotto lotto.c

str="9, 12, 17, 23, 28, 49"

if [ $# -gt 0 ]; then
	count=$(($1))
else
	count=1
fi

nr=0

while [ $count -gt 0 ]
do
	win=`~/lotto 1000000 | grep "$str" | wc -l`
	if [ $win -gt 0 ]; then
		echo $nr
	fi
	nr=$(($nr + 1))
done

